<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>案例:二维码的显示</title>
  <style>
    .img {
      width: 200px;
      height: 200px;
    }
  </style>
</head>
<body>
  <!--模版语法-->
  <div id="app">
    <div @click="toggle">
      <button>切换</button>
    </div>
    <template v-if="isShowQRCode">
      <img src="https://img0.baidu.com/it/u=4146947590,1577640986&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1731">
    </template>
  </div>
  <script src="../lib/vue.js"></script>
  <script>
    // 使用vue
    const app = Vue.createApp({
      data: function(){
        return {
          isShowQRCode: true 
        }
      }
      ,methods: {
        toggle() {
          this.isShowQRCode = !this.isShowQRCode
        }
      }
    }
    )
    // 挂载 
    app.mount("#app")

  </script>

</body>
</html>
